@import "./_themes.scss";
//遍历主题map
@mixin themeify {
  @each $theme-name, $theme-map in $themes {
    //!global 把局部变量强升为全局变量
    $theme-map: $theme-map !global;
    //判断html的data-theme的属性值  #{}是sass的插值表达式
    //& sass嵌套里的父容器标识   @content是混合器插槽，像vue的slot
    [data-theme="#{$theme-name}"] & {
      @content;
    }
  }
}

//声明一个根据Key获取颜色的function
@function themed($key) {
  @return map-get($theme-map, $key);
}

//获取背景
@mixin background($color) {
  @include themeify {
    background: themed($color)!important;
  }
}
//获取背景颜色
@mixin background_color($color) {
  @include themeify {
    background-color: themed($color)!important;
  }
}
//获取背景图片
@mixin background_image($color) {
  @include themeify {
    background-image: themed($color)!important;
  }
}
//获取背景图片
@mixin background_size($color) {
  @include themeify {
    background-size: themed($color)!important;
  }
}


@mixin content($color) {
  @include themeify {
    content: themed($color)!important;
  }
}


@mixin border_bottom($color) {
  @include themeify {
    border-bottom: themed($color)!important;
  }
}

//获取边框
@mixin border($color) {
  @include themeify {
    border: themed($color)!important;
  }
}
@mixin border_color($color) {
  @include themeify {
    border-color: themed($color)!important;
  }
}

//获取字体颜色
@mixin font_color($color) {
  @include themeify {
    color: themed($color)!important;
  }
}

//获取边框颜色
@mixin border_color($color) {
  @include themeify {
    border-color: themed($color)!important;
  }
}
//获取边框颜色
@mixin border_image($color) {
  @include themeify {
    border-image: themed($color)!important;
  }
}

//获取表单输入框颜色
@mixin form_input_color($color) {
  @include themeify {
    background: themed($color)!important;
  }
}

//获取表单盒子背景颜色
@mixin form_bgcolor($color) {
  @include themeify {
    background: themed($color)!important;
  }
}

//获取表格头部背景颜色
@mixin table_head_bgcolor($color) {
  @include themeify {
    background: themed($color)!important;
  }
}

// 获取首页导航图
@mixin home_item($color) {
  @include themeify {
    background-image: themed($color) !important;
  }
}
